﻿/* 
 * Author Copyright: Billy McCafferty. 
 * Copied or heavily influenced by : http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx 
 * Released under: The Code Project Open License (CPOL) 1.02 (See http://www.codeproject.com/info/cpol10.aspx)
 */

using System.Collections.Generic;

namespace Twipler.Data.Access
{
    public interface IDao<T, IdT>
    {
        T GetById(IdT id, bool shouldLock);
        List<T> GetAll();
        List<T> GetByExample(T exampleInstance, params string[] propertiesToExclude);
        T GetUniqueByExample(T exampleInstance, params string[] propertiesToExclude);
        T Save(T entity);
        T SaveOrUpdate(T entity);
        void Delete(T entity);
        void CommitChanges();
    }
}